<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>代理商品 - 编辑商品</title>
<?php include($this->c['_homes']['_viewsHome'].'/_global/_head.php');?>
<link rel="stylesheet" type="text/css" href="/style/assets/plugins/bootstrap-datetimepicker/css/datetimepicker.css" />
</head>
<!-- BEGIN BODY -->
<body class="page-header-fixed page-sidebar-fixed">
<!-- BEGIN HEADER -->
<?php include($this->c['_homes']['_viewsHome'].'/_global/head.php');?>
<!-- END HEADER -->
<div class="clearfix"></div>
<!-- BEGIN CONTAINER -->
<div class="page-container" > 
  <!-- BEGIN HORIZONTAL MENU PAGE SIDEBAR1 -->
  <?php include($this->c['_homes']['_viewsHome'].'/_global/menu.php');?>
  <!-- END BEGIN HORIZONTAL MENU PAGE SIDEBAR --> 
  <!-- BEGIN PAGE -->
  <div class="page-content"> 
    <!-- BEGIN PAGE HEADER-->
    <div class="row">
      <div class="col-md-12"> 
        <!-- BEGIN PAGE TITLE & BREADCRUMB-->
        <h3 class="page-title"> 编辑商品 </h3>
        <ul class="page-breadcrumb breadcrumb">
          <li> <i class="icon-home"></i> <a href="/manage">后台</a> <i class="icon-angle-right"></i> </li>
          <li> 代理商品 <i class="icon-angle-right"></i> </li>
          <li> <a href="/agent/goodslist">商品列表</a> <i class="icon-angle-right"></i> </li>
          <li>编辑商品</li>
        </ul>
        <!-- END PAGE TITLE & BREADCRUMB--> 
      </div>
    </div>
    <!-- END PAGE HEADER--> 
    <!-- BEGIN PAGE CONTENT-->
    
    <div class="row">
      <div class="col-md-12"> 
        <!-- BEGIN SAMPLE FORM PORTLET-->
        <form class="form-horizontal" method="post" onSubmit="return chkfrm();" action="/agent/savegoods" role="form">
          <input type="hidden" name="act" value="edit">
          <input type="hidden" name="goods_id" value="<?=$this->data['goods_id'];?>">
          <input type="hidden" name="ref" value="<?=$_SERVER['HTTP_REFERER'];?>">
          <div class="tabbable tabbable-custom boxless">
            <ul class="nav nav-tabs">
              <li class="active"><a href="#tab_0" data-toggle="tab">基本信息</a></li>              
            </ul>
            <div class="tab-content"> 
              <!--Tab0-->
              <div class="tab-pane active" id="tab_0">
                <div class="portlet box blue ">
                  <div class="portlet-title">
                    <div class="caption"> <i class="icon-reorder"></i> 基本信息 </div>
                  </div>
                  <div class="portlet-body form">
                    <div class="form-body">
                      <div class="form-group">
                        <label  class="col-md-2 control-label">商品ID</label>
                        <div class="col-md-9">
                        <h5><?=$this->data['goods_id'];?></h5>                          
                        </div>
                      </div>
                      
                      <div class="form-group">
                        <label  class="col-md-2 control-label">商品名称<span class="required">*</span></label>
                        <div class="col-md-9">
                          <input type="text" name="goods_name" id="_goods_name" maxlength="40" class="form-control"  placeholder="请输入商品名称" value="<?=stripslashes($this->data['name']);?>">
                          <span class="help-block">40个汉字以内</span> </div>
                      </div>
                      <hr>
                      <div class="form-group">
                        <label  class="col-md-2 control-label">市场价格<span class="required">*</span></label>
                        <div class="col-md-6">
                          <input type="text" name="market_price" value="<?=$this->data['market_price'];?>" id="market_price" maxlength="10" class="form-control">
                          <span class="help-block">例如：10.00</span> </div>
                      </div> 
                      <hr>
                      <div class="form-group memberprice">
                        <label  class="col-md-2 control-label">县代价格<span class="required">*</span></label>
                        <div class="col-md-6">
                          <input type="text" name="price_2" id="price_2" maxlength="10" class="form-control" value="<?=$this->data['price_2'];?>">
                          <span class="help-block">例如：10.00</span> </div>
                      </div>
                      <div class="form-group memberprice">
                        <label  class="col-md-2 control-label">市代价格<span class="required">*</span></label>
                        <div class="col-md-6">
                          <input type="text" name="price_3" id="price_3" maxlength="10" class="form-control" value="<?=$this->data['price_3'];?>">
                          <span class="help-block">例如：10.00</span> </div>
                      </div>
                      <div class="form-group memberprice">
                        <label  class="col-md-2 control-label">省代价格<span class="required">*</span></label>
                        <div class="col-md-6">
                          <input type="text" name="price_4" id="price_4" maxlength="10" class="form-control" value="<?=$this->data['price_4'];?>">
                          <span class="help-block">例如：10.00</span> </div>
                      </div> 
                      <hr>
                      <div class="form-group memberprice">
                        <label  class="col-md-2 control-label">县代级别推荐奖<span class="required">*</span></label>
                        <div class="col-md-6">
                          <input type="text" name="recommend_2" id="recommend_2" maxlength="10" class="form-control" value="<?=$this->data['recommend_2'];?>">
                          <span class="help-block">例如：10.00</span> </div>
                      </div>
                      <div class="form-group memberprice">
                        <label  class="col-md-2 control-label">市代级别推荐奖<span class="required">*</span></label>
                        <div class="col-md-6">
                          <input type="text" name="recommend_3" id="recommend_3" maxlength="10" class="form-control" value="<?=$this->data['recommend_3'];?>">
                          <span class="help-block">例如：10.00</span> </div>
                      </div>
                      <div class="form-group memberprice">
                        <label  class="col-md-2 control-label">省代级别推荐奖<span class="required">*</span></label>
                        <div class="col-md-6">
                          <input type="text" name="recommend_4" id="recommend_4" maxlength="10" class="form-control" value="<?=$this->data['recommend_4'];?>">
                          <span class="help-block">例如：10.00</span> </div>
                      </div>          
                      <hr>
                      <div class="form-group">
                        <label class="col-md-2 control-label">状态</label>
                        <div class="col-md-9">
                          <div class="radio-list">
                            <label class="radio-inline">
                            <div id="uniform-optionsRadios4" class="radio"><span class="">
                              <input name="stat" id="optionsRadios4" value="1"<?=$this->data['status']==1 ? ' checked' : '';?> type="radio">
                              </span></div>
                            <span class="label label-success">正常</span>
                            </label>
                            <label class="radio-inline">
                            <div id="uniform-optionsRadios5" class="radio"><span>
                              <input name="stat" id="optionsRadios5" value="2"<?=$this->data['status']==2 ? ' checked' : '';?> type="radio">
                              </span></div>
                            <span class="label label-danger">禁用</span>
                            </label>
                            <label class="radio-inline">
                            <div id="uniform-optionsRadios5" class="radio"><span>
                              <input name="stat" id="optionsRadios5" value="3" type="radio">
                              </span></div>
                            <span class="label label-default">删除</span>
                            </label>
                          </div>
                        </div>
                      </div> 
         		 
                    </div>
                    <div class="form-actions fluid">
                      <div class="col-md-offset-2 col-md-9">
                        <button type="submit" class="btn blue">提交</button>
                        <button type="button" class="btn default" onClick="history.back(1);">取消</button>
                      </div>
                    </div>
                  </div>
                </div>
              </div>                            
              <!--End Tab--> 
            </div>
          </div>
        </form>
        <!-- END SAMPLE FORM PORTLET--> 
      </div>
    </div>
    <!-- END PAGE CONTENT--> 
  </div>
  <!-- END PAGE --> 
</div>
<!-- END CONTAINER -->
<?php include($this->c['_homes']['_viewsHome'].'/_global/_footer.php');?>
<script>
jQuery(document).ready(function() {    
   App.init();
});

function chkfrm(){
  if($("#_goods_name").prop("value")==""){
    swal("请填写商品名称");
    return false;
  }
  
  
  if($("#market_price").prop("value")==""){
    swal("请填写市场价格");
    return false;
  }

  if($("#price_2").prop("value")==""){
    alert("请填写县代价格");
    return false;
  }

  if($("#price_3").prop("value")==""){
    alert("请填写市代价格");
    return false;
  }

  if($("#price_4").prop("value")==""){
    swal("请填写省代价格");
    $("#_two_price").focus();
    return false;
  }

  if($("#recommend_2").prop("value")==""){
    alert("请填写县代级别推荐奖");
    return false;
  }

  if($("#recommend_3").prop("value")==""){
    alert("请填写市代级别推荐奖");
    return false;
  }

  if($("#recommend_4").prop("value")==""){
    swal("请填写省代级别推荐奖");
    $("#_two_price").focus();
    return false;
  }
  
}

</script> 
<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>